/**
 * 
 */
package com.alessandrodonato.elledia.model;

import static javax.persistence.GenerationType.IDENTITY;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

/**
 * @author Alessandro Donato
 *
 * 18/feb/2013
 */

/*
	@Entity annotation is used to declare the POJO as persistent entity.
	@Table annotation is used to map the POJO class to the table. In our case it is 'certificato' table in database.
	@Id represents the identifier property.
	@GeneratedValue declares that the identifier value will be generated by the database automatically. 
	@Column is used to map the property to the column of the table.
*/

@Entity
@Table	(name = "fornitori", catalog = "elledia", 
				uniqueConstraints = {
						@UniqueConstraint(columnNames = "ID")})
public class Fornitore implements Serializable {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = -8682053130308009125L;
	private int id;
	private String ragioneSociale;
	private String indirizzo;
	private String cap;
	private String citta;
	private String country;
	private String email;
	private String telefono;
	private String fax;
	private String piva;
	private boolean enabled;
	private String note;

	@Id
	@GeneratedValue (strategy = IDENTITY)
	@Column (name = "ID",unique = true, nullable = false)
	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	@Column (name = "ragione_sociale", nullable = false)
	public String getRagioneSociale() {
		return ragioneSociale;
	}

	public void setRagioneSociale(String ragioneSociale) {
		this.ragioneSociale = ragioneSociale;
	}

	@Column (name = "indirizzo", nullable = true)
	public String getIndirizzo() {
		return indirizzo;
	}

	public void setIndirizzo(String indirizzo) {
		this.indirizzo = indirizzo;
	}

	@Column (name = "cap", nullable = true)
	public String getCap() {
		return cap;
	}

	public void setCap(String cap) {
		this.cap = cap;
	}

	@Column (name = "citta", nullable = true)
	public String getCitta() {
		return citta;
	}

	public void setCitta(String citta) {
		this.citta = citta;
	}

	@Column (name = "email", nullable = true)
	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	@Column (name = "fax", nullable = true)
	public String getFax() {
		return fax;
	}

	public void setFax(String fax) {
		this.fax = fax;
	}

	@Column (name = "telefono")
	public String getTelefono() {
		return telefono;
	}

	public void setTelefono(String telefono) {
		this.telefono = telefono;
	}

	@Column (name = "piva")
	public String getPiva() {
		return piva;
	}

	public void setPiva(String piva) {
		this.piva = piva;
	}

	@Column (name = "country")
	public String getCountry() {
		return country;
	}

	public void setCountry(String country) {
		this.country = country;
	}

	@Column (name = "enabled")
	public boolean isEnabled() {
		return enabled;
	}

	public void setEnabled(boolean enabled) {
		this.enabled = enabled;
	}

	@Column (name = "note")
	public String getNote() {
		return note;
	}

	public void setNote(String note) {
		this.note = note;
	}

	public static long getSerialversionuid() {
		return serialVersionUID;
	}
	
	@Override
	public String toString () {
		return "Fornitore [id = " + id + ", ragioneSociale = " + ragioneSociale + ", telefono = " + telefono + ", piva = " + piva + "]";
	}

	
}
